// 渣新窗口中打开外链
angular.module('app').directive('external', ($window) => {
  return {
    restrict: 'A',
    link: (scope, element, attrs) => {
      element.on('click', (e) => {
        e.preventDefault();
        if (attrs.href) {
          $window.open(attrs.href);
        }
      })
    }
  }
});